package communicate;

import java.util.ArrayList;

import com.UI.Chat;
import com.UI.ChatEntity;

public class ChatPool {
	private static ArrayList<Chat> chatPool = new ArrayList<Chat>();
	
	public static Chat getChat(String id){
		for(Chat c: chatPool)
			if(c.getID().equals(id))
				return c;
		return null;
	}
	
	public static void addChat(String id , ChatEntity entity){
		Chat chat=new Chat();
		chat.initChat(id,entity);
		chatPool.add(chat);
	}
}
